<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1,minimum-scale=1, user-scalable=no">
		<title>暂时性死区</title>
		
		<script type="text/javascript">
		{
			temp = 10
			// Uncaught ReferenceError: sum is not defined 
			// 暂时性死区 temporal dead zone
			// temp变量在此代码块中有效，是使用let声明的，
			//使用let 声明的变量使用规则，必须是先声明后使用，否则出现tdz
			console.log(temp)
			let temp;
		}
		</script>
	</head>
	<body>
		<div id="app">
			<!-- todo -->
		</div>
	</body>
</html>